{"ast":null,"code":"import _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nvar _excluded = [\"getTrigger\", \"target\"];\nimport * as React from 'react';\nfunction defaultTrigger(store, options) {\n  var _options$disableHyste = options.disableHysteresis,\n    disableHysteresis = _options$disableHyste === void 0 ? false : _options$disableHyste,\n    _options$threshold = options.threshold,\n    threshold = _options$threshold === void 0 ? 100 : _options$threshold,\n    target = options.target;\n  var previous = store.current;\n  if (target) {\n    // Get vertical scroll\n    store.current = target.pageYOffset !== undefined ? target.pageYOffset : target.scrollTop;\n  }\n  if (!disableHysteresis && previous !== undefined) {\n    if (store.current < previous) {\n      return false;\n    }\n  }\n  return store.current > threshold;\n}\nvar defaultTarget = typeof window !== 'undefined' ? window : null;\nexport default function useScrollTrigger() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var _options$getTrigger = options.getTrigger,\n    getTrigger = _options$getTrigger === void 0 ? defaultTrigger : _options$getTrigger,\n    _options$target = options.target,\n    target = _options$target === void 0 ? defaultTarget : _options$target,\n    other = _objectWithoutPropertiesLoose(options, _excluded);\n  var store = React.useRef();\n  var _React$useState = React.useState(function () {\n      return getTrigger(store, other);\n    }),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    trigger = _React$useState2[0],\n    setTrigger = _React$useState2[1];\n  React.useEffect(function () {\n    var handleScroll = function handleScroll() {\n      setTrigger(getTrigger(store, _extends({\n        target: target\n      }, other)));\n    };\n    handleScroll(); // Re-evaluate trigger when dependencies change\n    target.addEventListener('scroll', handleScroll, {\n      passive: true\n    });\n    return function () {\n      target.removeEventListener('scroll', handleScroll, {\n        passive: true\n      });\n    };\n    // See Option 3. https://github.com/facebook/react/issues/14476#issuecomment-471199055\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [target, getTrigger, JSON.stringify(other)]);\n  return trigger;\n}","map":{"version":3,"names":["_extends","_objectWithoutPropertiesLoose","_excluded","React","defaultTrigger","store","options","disableHysteresis","threshold","target","previous","current","pageYOffset","undefined","scrollTop","defaultTarget","window","useScrollTrigger","getTrigger","other","useRef","useState","trigger","setTrigger","useEffect","handleScroll","addEventListener","passive","removeEventListener","JSON","stringify"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@mui/material/esm/useScrollTrigger/useScrollTrigger.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"getTrigger\", \"target\"];\nimport * as React from 'react';\nfunction defaultTrigger(store, options) {\n  const {\n    disableHysteresis = false,\n    threshold = 100,\n    target\n  } = options;\n  const previous = store.current;\n  if (target) {\n    // Get vertical scroll\n    store.current = target.pageYOffset !== undefined ? target.pageYOffset : target.scrollTop;\n  }\n  if (!disableHysteresis && previous !== undefined) {\n    if (store.current < previous) {\n      return false;\n    }\n  }\n  return store.current > threshold;\n}\nconst defaultTarget = typeof window !== 'undefined' ? window : null;\nexport default function useScrollTrigger(options = {}) {\n  const {\n      getTrigger = defaultTrigger,\n      target = defaultTarget\n    } = options,\n    other = _objectWithoutPropertiesLoose(options, _excluded);\n  const store = React.useRef();\n  const [trigger, setTrigger] = React.useState(() => getTrigger(store, other));\n  React.useEffect(() => {\n    const handleScroll = () => {\n      setTrigger(getTrigger(store, _extends({\n        target\n      }, other)));\n    };\n    handleScroll(); // Re-evaluate trigger when dependencies change\n    target.addEventListener('scroll', handleScroll, {\n      passive: true\n    });\n    return () => {\n      target.removeEventListener('scroll', handleScroll, {\n        passive: true\n      });\n    };\n    // See Option 3. https://github.com/facebook/react/issues/14476#issuecomment-471199055\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [target, getTrigger, JSON.stringify(other)]);\n  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